package com.marry.multidatasource.controller;

import com.marry.multidatasource.model.TableResItem;
import com.marry.multidatasource.model.bd.Sealupinfo;
import com.marry.multidatasource.service.SealupinfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author ml
 * @create 2018-01-09--13:51
 */
@RestController
public class SealupinfoController {

    @Autowired
    private SealupinfoService sealupinfoService;

    @RequestMapping("/getSealupinfoListByRealeunum")
    public TableResItem getSealupinfoListByRealeunum(String realeunum){


        TableResItem item=new TableResItem();
        List<Sealupinfo> sealupinfoList=sealupinfoService.getSealupinfoListByRealeunum(realeunum);
        item.setData(sealupinfoList);
        item.setCount(sealupinfoList.size());

        return item;

    }
}
